<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件</title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
		  <h1 v-if="seen">seen</h1>
		  <h1 v-else v-on:click="greet">no seen</h1>
		</div>
		
		
		<script>
			var app = new Vue({
			  el: '#app',
			  methods:{
				  greet: function(){
					  alert("hello")
				  }
			  },
			  data: {
			    seen:  false
			  }
			})
			
		
		</script>
	</body>
</html>